{include file="public:header" /}
<!--添加会员-->
<form id="info_form" action="{:url('User/addDo')}" method="post" enctype="multipart/form-data">
    <div class="pad_lr_10">
        <div class="col_tab">
            <ul class="J_tabs tab_but cu_li">
                <li class="current">会员信息</li>
            </ul>
            <div class="J_panes">
                <div class="content_list pad_10">
                    <table width="100%" cellspacing="0" class="table_form">

                        <tr>
                            <th width="120">所属模型 :</th>
                            <td>
                                {volist name='modelArr' id='vo'}
                                <input type="radio" name="model" id="m_{$key}" value="{$key}"><label for="m_{$key}">{$vo}</label>
                                {/volist}
                            </td>
                        </tr>
                        <tr>
                            <th>用户名: </th>
                            <td><input type="text" name="username" class="input-text" id="username" size="20"></td>
                        </tr>
                        <tr>
                            <th>密码: </th>
                            <td><input type="password" id="pwd" name="password" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>手机号:</th>
                            <td><input type="text" name="mobile" id="mobile" class="input-text" size="20" /></td>
                        </tr>
                        <tr>
                            <th>邮箱:</th>
                            <td><input type="text" name="email" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>购房热线:</th>
                            <td><input type="text" name="buy_phone" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>所属公司:</th>
                            <td><input type="text" name="company" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>真实姓名:</th>
                            <td><input type="text" name="data[truename]" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>身份证号:</th>
                            <td><input type="text" name="data[bodycode]" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>联系QQ:</th>
                            <td><input type="text" name="data[qq]" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>昵称:</th>
                            <td><input type="text" name="nickname" class="input-text" size="20"></td>
                        </tr>
                        <tr>
                            <th>生日:</th>
                            <td>
                                <input type="text" name="data[birthday]" class="date" onclick="myCalendar();" size="20">
                            </td>
                        </tr>
                        <tr>
                            <th>联系地址:</th>
                            <td><input type="text" name="data[address]" class="input-text" size="50"></td>
                        </tr>
                    </table>
                </div>

            </div>
            <div class="mt10"><input type="submit" value="提交" id="dosubmit" name="dosubmit" class="btn btn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
        </div>
    </div>
</form>
{include file="public:footer" /}
<script src="__PUBLIC__/js/calendar/WdatePicker.js" charset="utf-8"></script>
<script>
    function myCalendar(id){
        WdatePicker({dateFmt:'MM-dd',el:id});
    }
    $(function() {
        var check_name_url = "{:url('User/ajaxCheckUser')}";
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#username").formValidator({onshow:'请填写昵称',onfocus:'请填写昵称'}).inputValidator({min:1,onerror:'格式不正确'}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            onerror : '该昵称已被占用',
            onwait : '查询中,请稍候...'
        });
        $("#pwd").formValidator({onshow:'请填写密码',onfocus:'请填写密码'}).inputValidator({min:6,onerror:'密码长度至少6位'});
        $("#mobile").formValidator({onshow:'请填写手机号',onfocus:'请填写手机号'}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"手机号码格式错误"}).ajaxValidator({
            type : "get",
            url : check_name_url,
            datatype : "json",
            async:'false',
            success : function(result){
                if(result.status == 0){
                    return false;
                }else{
                    return true;
                }
            },
            onerror : '该手机号已注册',
            onwait : '查询中,请稍候...'
        });
    });
</script>

</body>
</html>